//
//  BLRightTableViewCell.m
//  百思不得姐
//
//  Created by hbl on 16/3/16.
//  Copyright © 2016年 hbl. All rights reserved.
//

#import "BLRightTableViewCell.h"
#import "BLPerson.h"
#import "UIImageView+WebCache.h"
#import "BLLoginViewController.h"
@interface BLRightTableViewCell()
@property (weak, nonatomic) IBOutlet UIImageView *headImage;
@property (weak, nonatomic) IBOutlet UILabel *name;
@property (weak, nonatomic) IBOutlet UILabel *followNumber;
- (IBAction)toFollow:(id)sender;

@property (weak, nonatomic) IBOutlet UIImageView *headImageView;
@end

@implementation BLRightTableViewCell

- (void)awakeFromNib {
    // Initialization code
    self.headImageView.layer.cornerRadius = 20;
    self.headImageView.clipsToBounds = YES;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state

}

- (void)setPerson:(BLPerson *)person
{
    _person = person;
    self.name.text = person.screen_name;
    self.followNumber.text = person.fans_count;
    [self.headImage sd_setImageWithURL:[NSURL URLWithString:person.header]];
    
}

- (IBAction)toFollow:(id)sender {
    BLLoginViewController *login = [[BLLoginViewController alloc]init];
    if ([self.delegate respondsToSelector:@selector(rightTableViewWith:destController:)]) {
        [self.delegate rightTableViewWith:self destController:login];
    }

}
@end
